package com.cheer.dao;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.cheer.entity.ExVotePersonEntity;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;

import java.util.List;

/**
 * 点赞活动人员表
 * 
 * @author cheer
 */
@Mapper
public interface ExVotePersonDao extends BaseMapper<ExVotePersonEntity> {

    void incrVote(Long personId);

    void decrVote(Long personId);

    default List<ExVotePersonEntity> selectByActivityId(Long actId) {

        QueryWrapper<ExVotePersonEntity> queryWrapper = new QueryWrapper();
        queryWrapper.lambda().eq(ExVotePersonEntity::getActivityId, actId);
        List list = selectList(queryWrapper);

        return list;
    }

}
